﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using VO;
using System.Data;
using System.Data.SqlClient;
namespace BUS
{
    class HoaDon_BUS:SqlDataProvider
    {
        SqlDataProvider db = new SqlDataProvider();
        private static HoaDon_DAO _HoaDonDAO = new HoaDon_DAO();
        public static bool Customer_Insert(VO.HoaDon_OBJ obj)
        {
            return _HoaDonDAO.Customer_Insert(obj);
        }
        public DataTable MaHoaDon()
        {
            return db.myTable_sp("sp_laymaHoaDon");
        }
        public DataTable ThongkeSanPham()
        {
            return db.myTable_sp("Sp_all_SP_Thongke");
        }
        public DataTable LuuLuongNhapTheoNam(string TenSP)
        {
            SqlDataProvider db = new SqlDataProvider();
            SqlParameter[] p = new SqlParameter[1];
            p[0] = new SqlParameter("@TenSanPham", TenSP);
            return db.myTable_sp("sp_ThongkeluuluongNhap_Theothang", p);
        }
        public DataTable LuuLuongXuatTheoNam(string TenSP)
        {
            SqlDataProvider db = new SqlDataProvider();
            SqlParameter[] p = new SqlParameter[1];
            p[0] = new SqlParameter("@TenSanPham", TenSP);
            return db.myTable_sp("sp_ThongkeluuluongXuat_Theothang", p);
        }
        public DataTable ThongKeHoaDonNhapTheoThang(int Thang)
        {
            SqlDataProvider db = new SqlDataProvider();
            SqlParameter[] p = new SqlParameter[1];
            p[0] = new SqlParameter("@Thang", Thang);
            return db.myTable_sp("ThongKeHoaDonNhapTheoThang", p);
        }
        public DataTable ThongKeHoaDonXuatTheoThang(int Thang)
        {
            SqlDataProvider db = new SqlDataProvider();
            SqlParameter[] p = new SqlParameter[1];
            p[0] = new SqlParameter("@Thang", Thang);
            return db.myTable_sp("ThongKeHoaDonXuatTheoThang", p);
        }
    }
}
